//
//  OilCardAdditional_IdCardCell.m
//  Base_App
//
//  Created by Yutian Duan on 2019/6/19.
//  Copyright © 2019年 Wanwin. All rights reserved.
//

#import "OilCardAdditional_IdCardCell.h"

@implementation OilCardAdditional_IdCardCell

- (void)awakeFromNib {
  [super awakeFromNib];
  // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  [super setSelected:selected animated:animated];
  
  // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  if (self) {
    [self createViews];
  }
  return self;
}

- (void)createViews {
  
  _tipLabel = [[UILabel alloc] init];
  _tipLabel.textColor = DEF_BLACK;
  _tipLabel.font = [UIFont systemFontOfSize:14.0];
  _tipLabel.text = [NSString stringWithFormat:@"%@:",YTLocalizedString(@"身份证上传")];
  [self.contentView addSubview:_tipLabel];
  
  _id_imageView = [[UIImageView alloc] init];
  _id_imageView.image = [UIImage imageNamed:@"Oil_card_imageUpPlace"];
  [self.contentView addSubview:_id_imageView];
  
  _takeButton = [[UIButton alloc] init];
  [_takeButton setImage:[UIImage imageNamed:@"Oil_card_image_take"] forState:UIControlStateNormal];
  [self.contentView addSubview:_takeButton];
  
  _lineView = [[UIView alloc] init];
  [self.contentView addSubview:_lineView];
  
  
  [_tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
    make.leading.mas_equalTo(self.contentView.mas_leading).offset(30);
    make.top.mas_equalTo(self.contentView.mas_top).offset(20);
    make.width.mas_equalTo(@100);
    make.height.mas_equalTo(@30);
  }];
  
  [_id_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.leading.mas_equalTo(self.tipLabel.mas_trailing).offset(10);
    make.top.mas_equalTo(self.contentView.mas_top).offset(20);
    make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(-20);
    make.width.mas_equalTo(self.id_imageView.mas_height);
  }];
  
  [_takeButton mas_makeConstraints:^(MASConstraintMaker *make) {
    make.size.mas_equalTo(CGSizeMake(60, 60));
    make.trailing.mas_equalTo(self.contentView.mas_trailing).offset(-30);
    make.centerY.mas_equalTo(self.tipLabel.mas_centerY);
  }];
 
  [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.leading.mas_equalTo(self.tipLabel.mas_leading);
    make.bottom.mas_equalTo(self.contentView.mas_bottom);
    make.height.mas_equalTo(@0.8);
    make.trailing.mas_equalTo(self.contentView.mas_trailing).offset(-30);
  }];
  
  
}

@end

